<template>
	<view>
		<view class="bc_img"></view>
		<view class="tengfa_log">
			<view class="teng_title">TENGFA</view>
			<view class="teng_car">腾发名车广场</view>
			<view class="teng_huan">买亏可退、7天无理由退车、15天可换、终身质保</view>
		</view>

		<view class="uni-padding-wrap ">
			<uni-segmented-control :current="currentItem" :values="items" :style-type="'text'" :active-color="'#007aff'"
				@clickItem="onClickItem"/>
		</view>

		<view class="content">
			<!-- 选项卡1的内容 -->
			<view v-if="currentItem === 0">
				<liaojie></liaojie>
			</view>
			<!-- 选项卡2的内容 -->
			<view v-if="currentItem === 1">
				<Aftersales></Aftersales>
			</view>
			<!-- 选项卡3的内容 -->
			<view v-if="currentItem === 2">
				<changcar></changcar>
			</view>
			<view v-if="currentItem === 3">
				<insure></insure>
			</view>
		</view>
	</view>
</template>

<script>
	import liaojie from "../../commonts/liaojie/liaojie.vue";
	import Aftersales from "../../commonts/Aftersales/Aftersales.vue";
	import changcar from "../../commonts/changcar/changcar.vue";
	import insure from "../../commonts/insure/insure.vue";
	import {getWuj} from "../../untils/ajxas.js";
	export default {
		components:{
			liaojie,
			Aftersales,
			changcar,
			insure
		},
		data() {
			return {
				items: ['了解腾发', '售后服务', '汽车改装', "保险服务"],
				currentItem: 0,
				list: []
			}
		},
		beforeCreate() {
			getWuj().then(res => {
				console.log(res);
				this.list = res.data.data.content
			})
		},
		methods: {
			onClickItem(e) {
				if (this.currentItem !== e.currentIndex) {
					this.currentItem = e.currentIndex
				}
			},
		}
	}
</script>

<style>
	.bc_img {
		width: 750rpx;
		height: 330rpx;
		background-image: url("../../static/learn_banner.de34a1c3.jpg");
		background-size: 100%;
	}

	.tengfa_log {
		margin-top: -300rpx;
	}

	.teng_title {
		width: 750rpx;
		text-align: center;
		z-index: -1;
		opacity: 0.3;
		color: #ccc;
		font-size: 100rpx;
	}

	.teng_car {
		font-size: 60rpx;
	}

	.teng_huan,
	.teng_car {
		width: 750rpx;
		height: 86rpx;
		text-align: center;
		color: #ffffff;
	}
	.content{
		width: 750rpx;
	}
</style>